//package com.ruitaowang.admin.other;
//
//import com.ruitaowang.account.security.LYSecurityUtil;
//import com.ruitaowang.core.domain.Role;
//import com.ruitaowang.core.domain.SNSWXUserinfo;
//import com.ruitaowang.core.domain.SysUser;
//import com.ruitaowang.core.utils.LYBeanUtils;
//import com.ruitaowang.core.utils.RandomUtils;
//import com.ruitaowang.core.web.BaseController;
//import com.ruitaowang.core.web.MsgOut;
//import com.ruitaowang.goods.service.WXUserinfoService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//import org.springframework.util.ObjectUtils;
//import org.springframework.util.StringUtils;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//import tech.lingyi.wx.msg.out.TemplateData;
//import tech.lingyi.wx.msg.out.TemplateItem;
//import wx.wechat.service.mp.MPService;
//
//import java.io.IOException;
//import java.lang.reflect.InvocationTargetException;
//import java.text.SimpleDateFormat;
//import java.util.Date;
//import java.util.List;
//import java.util.Map;
//
//@RestController
////@Component
//public class OrderAfterController extends BaseController {
//
//    @Autowired
//    private WXUserinfoService wxUserinfoService;
//    @Value("${host.api}")
//    private String host;
//
////    @Scheduled(cron = "0 25 11 * * ?")
////    public void buildQRNotify() {
////        int[] users = {64022,65446};
////        for(int i = 0;i < users.length;i++){
////            TemplateData templateData = TemplateData.New();
////            SNSWXUserinfo snswxUserinfo = wxUserinfoService.selectByPK((long)users[i]);
////            SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
////            String date =  df.format(new Date());
////            if (ObjectUtils.isEmpty(snswxUserinfo)) {
////                return;
////            }
////            templateData.setTouser(snswxUserinfo.getOpenid());
////            templateData.setTemplate_id("5Xd_XB7yMZ1xUb71o0b-I09e3gOVhNeW9-2iwVq3oQ8");
////            templateData.setTopcolor("#FF3333");
////            templateData.setData(new TemplateItem());
////            templateData.add("first", "您的未发货订单由于商家原因无法进行发货，系统已经为您自动取消，给您到来不便深感抱歉！订单金额已返回到您的红包中，请查收！" , "#173177");
////            templateData.setUrl(host + "/wap/gxt");
////            templateData.add("keyword1", "订单取消", "#0044BB");
////            templateData.add("keyword2", date, "#0044BB");
////            templateData.add("remark", "感谢您使用首象共享", "#FF3333");
////            try {
////                new MPService().sendAPIEnter4TemplateMsg(templateData);
////            } catch (Exception e) {
////                e.printStackTrace();
////            }
////        }
////    }
//}
